package com.sweetguy.dto;

import com.sweetguy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Schema(name = "评论添加DTO")
@Data
public class CommentInsertDTO implements Serializable, RE {

    @NotNull(message = "集次表ID不能为空")
    @Schema(description = "集次表ID，季次表外键")
    private Long fkEpisodeId;

    @NotNull(message = "用户表ID不能为空")
    @Schema(description = "用户表ID，季次表外键")
    private Long fkUserId;

    @NotNull(message = "父评论ID不能为空")
    @Schema(description = "父评论ID，0视为根评论")
    private Long pid;

    @Schema(description = "评论内容")
    @NotEmpty(message = "评论内容不能为空")
    @Pattern(regexp = CONTENT_RE, message = CONTENT_RE_MSG)
    private String content;
}
